package com.yunhe.merchants.service;

import com.yunhe.common.exception.ArgumentErrorException;
import com.yunhe.common.model.mybatis.PageResult;
import com.yunhe.merchants.domain.DataPlanProject;
import com.yunhe.merchants.domain.DataProject;
import com.yunhe.merchants.domain.MyProject;
import com.yunhe.merchants.model.DataProjectUpload;
import com.yunhe.merchants.model.DataProjectCondition;
import org.springframework.web.multipart.MultipartFile;

import java.io.IOException;
import java.util.List;

/**
 * 经理项目池与公共商机库
 * @author hetao
 * @date 2021/05/10
 */
public interface IDataProjectService {


    /**
     * 删除
     */
    public void deleteDataProject(List<String> ids) throws ArgumentErrorException;

    /**
     * 通过条件查询项目池信息
     * @param dataProjectCondition
     * @return
     */
    PageResult findProjectByCondition(DataProjectCondition dataProjectCondition) throws ArgumentErrorException;

    /**
     * 新增项目池信息
     * @param dataProject
     * @return
     */
    DataProject createDataProject(DataProject dataProject) throws ArgumentErrorException;

    /**
     * 通过id查看项目池信息
     * @param id
     * @return
     */
    DataProject getDataPorjectById(String id);

    /**
     * 通过企业id分页查看历史状态信息
     * @param id
     * @param page
     * @param size
     * @return
     */
    PageResult getHistoryStatus(String id, int page, int size);

    /**
     * 招商经理将项目信息分配给对应的业务员
     * @param ids
     * @param salesman
     * @param deptId
     */
    void allocationProjects(String ids, Long salesman, Long deptId) throws ArgumentErrorException;

    /**
     * 将经理项目池的信息公开到公共商机库
     * @param ids
     */
    void overt(String ids) throws ArgumentErrorException;

    /**
     * 将经理项目池的数据移个人的历史项目并从经理项目池移出
     * @param id
     */
    void moveOut(String id) throws ArgumentErrorException;

    /**
     * 业务员在公共商机库进行认领
     * @param ids
     */
    void claim(String ids) throws ArgumentErrorException;

    /**
     * 经理项目池批量导入
     * @param file
     */
    void uploadManageProject(MultipartFile file) throws ArgumentErrorException, IOException;

    void upload(List<DataProjectUpload> dataProejctUploads , Long userId,Long orgId,String dataType) throws ArgumentErrorException;

    /**
     * 公共商机库批量导入
     * @param file
     */
    void uploadPublicProject(MultipartFile file) throws ArgumentErrorException, IOException;

    List<DataProject> exportManageProject(String ids, DataProjectCondition dataProjectCondition) throws ArgumentErrorException;

    /**
     * 批量新增
     * @param dataProjects
     */
    void batchCreate(List<DataProject> dataProjects);

    /**
     * 项目返回项目池
     * @param myProject
     * @param dataType 数据类型
     * @return void
     * @create 2021/5/12 14:28
     */
    void back(MyProject myProject , String dataType);

    void updateDataProjectByPlanId(DataPlanProject dataPlanProject);

    void backCreate(MyProject p, String dataType);

    void backUpDateOrCreate(MyProject p);
}
